/*
 * Copyright (c) 2024 Huawei Technologies Co.,Ltd.
 *
 * openGauss is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *
 * http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 * -------------------------------------------------------------------------
 *
 * htap.h
 * Interface for main HTAP facade.
 *
 * IDENTIFICATION
 * src/include/storage/htap/htap.h
 *
 * -------------------------------------------------------------------------
 */

#ifndef HTAP_H
#define HTAP_H

#include "gs_thread.h"

/** @brief Initializes HTAP engine. */
extern void InitHTAP();

extern void TermHTAP();

/** @brief Queries whether HTAP module is initialized. */
extern bool HTAPIsInitialized();

/**
 * @brief Notification from thread pool that a session ended (only when thread pool is ENABLED).
 */
extern void HTAPOnSessionClose();

/** @brief Launches the HTAP Flush thread. */
extern ThreadId HTAPStartFlush();

/** @brief Executes the HTAP Flush thread main loop. */
extern void HTAPExecFlush();

extern void HTAPRunWorker();

/** @brief Launches the HTAP XLogRedoer thread. */
extern ThreadId HTAPStartXLogRedoer();

/** @brief Executes the HTAP XLogRedoer thread main loop. */
extern void HTAPRunXlogRedoer();

#endif // HTAP_H
